{*
 %%%copyright%%%
 * phpMyTicket - ticket reservation system
 * Copyright (C) 2004-2005 Anna Putrino, Stanislav Chachkov. All rights reserved.
 *
 * This file is part of phpMyTicket.
 *
 * This file may be distributed and/or modified under the terms of the
 * "GNU General Public License" version 2 as published by the Free
 * Software Foundation and appearing in the file LICENSE included in
 * the packaging of this file.
 *
 * Licencees holding a valid "phpmyticket professional licence" version 1
 * may use this file in accordance with the "phpmyticket professional licence"
 * version 1 Agreement provided with the Software.
 *
 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE.
 *
 * The "phpmyticket professional licence" version 1 is available at
 * http://www.phpmyticket.com/ and in the file
 * PROFESSIONAL_LICENCE included in the packaging of this file.
 * For pricing of this licence please contact us via e-mail to 
 * info@phpmyticket.com.
 * Further contact information is available at http://www.phpmyticket.com/
 *
 * The "GNU General Public License" (GPL) is available at
 * http://www.gnu.org/copyleft/gpl.html.
 *
 * Contact info@phpmyticket.com if any conditions of this licencing isn't 
 * clear to you.
 
*}{if $shop_event.event_pm_id}
<br>
<div class="div_midtone">
<table class='table_midtone'>
<tr>
<td colspan='5' class="title2">
    Seating Sections and prices
</td></tr>


{category event_id=$shop_event.event_id stats="on"}
  {counter assign="cat_num" name='cat_num' print=false}
  {if ($cat_num-1) is div by 4}
    <tr><td class='small_title'>
    Ticket Section
</td>
    {capture assign=prices_row}
      <tr><td class='small_title'>
    Ticket Price
</td>
    {/capture} 
  {/if}
     
  <td class='small_title'>{$shop_category.category_name}</td>
  {capture assign=price}
    <td>
    {if $shop_category.cs_free>0}
      {$shop_category.category_price}
    {else}
      {#category_sold#}
    {/if}  
    </td>
  {/capture}   
  {assign var=prices_row value="$prices_row $price"}
  
  {if $cat_num is div by 4}
    </tr>
    {$prices_row}
    </tr>
  {/if}  
  

  {if $shop_category.cs_free>0}
  {assign var=js_array value="$js_array unnum_cats[unnum_cats.length]='`$shop_category.category_numbering`';"}
  {capture assign=opt}
      <option value='{$shop_category.category_id}'>
          {$shop_category.category_name} - &pound;{$shop_category.category_price}
      </option>
    {/capture}  
    {assign var=opt_array value="$opt_array $opt"}
  {/if}
{/category}

{if $cat_num is not div by 4}
    </tr>
    {$prices_row}
    </tr>
{/if}    
<tr>
<td colspan='5' align='left' class='note'>
<br>    
    {#prices_in#} {$organizer_currency}
</td></tr>
</table></div><br>

<script><!--
var unnum_cats=new Array;
{$js_array}

{literal}

function getElement(id){
     if(document.all) {return document.all(id);}
     if(document.getElementById) {return document.getElementById(id);}
}


function setQtyShown(){
      
      if(cat_select_e=getElement('cat_select')){
        if(qty_e=getElement('qqq')){
          if(unnum_cats[cat_select_e.selectedIndex]=='none'){
            qty_e.style.display='block';  
          }else{
            qty_e.style.display='none';  
          }
        }
      }
    }
-->
</script>
{/literal}

{if $shop_event.event_date ge $smarty.now|date_format:"%Y-%m-%d"}
<form name='catselect' method='get' action='index.php'>
   <div class="div_midtone">
   <table  class='table_midtone'>
   <tr><td class='title2' colspan='3' >    
    Select a Seating Section
</td></tr>

{if $shop_event.pm_image}
<tr><td colspan='3'>
<IMG SRC="files/{$shop_event.pm_image}"  BORDER=0  USEMAP="#ort_map">
<MAP NAME="ort_map">
{category event_id=$shop_event.event_id stats="on"}
{if $shop_category.cs_free gt 0}
<AREA {$shop_category.category_data} HREF="index.php?category_id={$shop_category.category_id}&event_id={$smarty.get.event_id}">
{/if}
{/category}
</MAP>
</td></tr></table></div></FORM>
{else}
<tr><td width='50%' align='right'><select name='category_id' onchange='setQtyShown()' id='cat_select' class="select">
   {$opt_array}
</select></td>
<td  align='left'>
<div id='qqq'  align='left' style='font-size:9px'>x <input type='text' name='qty' size=4 maxlength=2>

{if $shop_event.event_order_limit>0}
   ({#order_limit#} {$shop_event.event_order_limit}) 
{/if}

</div></td>
<td  align='left'>
<input type='submit' name='submit_cat' value='{#continue#}'></td></tr>
</table></div>
<input type='hidden' name='event_id' value='{$smarty.get.event_id}'>
</form><br>
{/if}
{/if}
{/if}
<script><!--
setQtyShown();
--></script>
  
